package com.spark.util;

import java.io.IOException;

import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.JsonSerializer;
import org.codehaus.jackson.map.SerializerProvider;

/**
 * FuntionSerializer.java
 * 
 * @version $Id: FuntionSerializer.java v 1.0 2010-12-14 下午04:04:39 IBM Exp $
 * @author <a href="mailto:njq.niu@hand-china.com">vincent</a>
 */
public class ReferenceSerializer extends JsonSerializer<ReferenceType> {

	@Override
	public void serialize(ReferenceType type, JsonGenerator jgen, SerializerProvider prov) throws IOException, JsonProcessingException {
		if(type.reference!=null)
		jgen.writeRawValue(type.reference);
	}
}
